<?php global $base_url; ?>
<div class="cart-wrapper">
    <?php if (!empty($data['cart_items']) && count($data['cart_items']) > 0): ?>
    <form action="<?php print $base_url . '/cart';?>" method="POST" name="form-cart">
        <div class="cart-content">
            <h2>Items</h2>
            <?php print theme('cart-items', array('items' => $data['cart_items']));?>
        </div>
        <div class="cart-services">
            <h2>Shipping Method</h2>

            <div class="shipping-method-wrapper">
                <?php if ($data['addresses']->rowCount() > 0): ?>
                <div class="address-select">
                    <label>Choose Address to Shipping:</label>
                    <select name="shipping_address_id" id="shipping_address_id" class="form-select">
                        <option value="">--Select--</option>
                        <?php $count = 1;?>
                        <?php foreach ($data['addresses'] as $address): ?>
                        <option value="<?php print $address->aid;?>"><?php print 'Address ' . $count;?></option>
                        <?php $count++; ?>
                        <?php endforeach; ?>
                    </select>
                </div>
                <?php endif;?>
                <a href="#" class="get-shipping-rates btn btn-large">Get Shipping Rates</a>

                <div id="shipping_rates_selection"></div>
            </div>
        </div>
        <div class="cart-services">
            <h2>Option Services</h2>

            <div class="services-wrapper">
                <?php $services = variable_get('wh_optional_services_fees', array());?>
                <?php foreach ($services as $k => $service): ?>
                <div>
                    <input type="checkbox" id="<?php print str_replace(' ', '_', strtolower($service->service));?>"
                           value="1"
                           name="cart_service[<?php print $k;?>]" <?php print !empty($_POST['cart_service'][$k])
                            ? 'checked="checked"' : '';?>/>
                    <label for="<?php print str_replace(' ', '_', strtolower($service->service));?>">
                        <?php print $service->service . ' - ' . $service->fee;?>
                    </label>
                </div>
                <?php endforeach;?>
            </div>
        </div>
        <div class="form-actions">
            <input type="submit" name="submit" value="Send package" class="btn btn-primary"/>
            <a href="<?php print $base_url . '/home';?>" class="btn" title="cancel">Cancel</a>
        </div>
    </form>
    <?php else: ?>
    <h3>
        You don't have any items in your cart.
        <a class="btn btn-primary" href="<?php print $base_url . '/home';?>">Go to my Locker</a>
    </h3>
    <?php endif;?>
</div>